package com.Sell.manage.mapper;

import java.util.List;

import com.Sell.manage.domain.Machine;
import com.Sell.manage.domain.Task;
import org.apache.ibatis.annotations.Select;

/**
 * 工单Mapper接口
 * 
 * @author emmm
 * @date 2024-12-20
 */
public interface TaskMapper 
{
    /**
     * 查询工单
     * 
     * @param taskId 工单主键
     * @return 工单
     */
    public Task selectTaskByTaskId(Long taskId);

    /**
     * 查询工单列表
     * 
     * @param task 工单
     * @return 工单集合
     */
    public List<Task> selectTaskList(Task task);

    /**
     * 新增工单
     * 
     * @param task 工单
     * @return 结果
     */
    public int insertTask(Task task);

    /**
     * 修改工单
     * 
     * @param task 工单
     * @return 结果
     */
    public int updateTask(Task task);

    /**
     * 删除工单
     * 
     * @param taskId 工单主键
     * @return 结果
     */
    public int deleteTaskByTaskId(Long taskId);

    /**
     * 批量删除工单
     * 
     * @param taskIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTaskByTaskIds(Long[] taskIds);

//    @Select("SELECT SUM(amount * price) AS total_sales FROM tb_order")
//    double getTotalSales();
//
//    @Select("SELECT * FROM tb_machine WHERE running_status = 'Stop'")
//    List<Machine> getFaultyMachines();
//
//    @Select("SELECT DATE(update_time) AS date, SUM(amount * price) AS sales FROM tb_order GROUP BY goods_id")
//    List<SaleData> getSaleData();
//
//    @Select("SELECT goods_name, SUM(amount) AS total_amount FROM tb_order GROUP BY goods_id ORDER BY total_amount DESC LIMIT 10")
//    List<HotSale> getHotSales();
}
